package org.jsbd.boss.common;


import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 
 * 响应返回类
 * @author <a href="mailto:zhouchao@xingbook.com" >周超</a>
 * @version 1.0.0
 */
public final class ResponseMapUtils {
	
    public static final Logger LOGGER = LoggerFactory.getLogger(ResponseMapUtils.class);

    public static Map<String,Object> responseSuccess() {
        Map<String,Object> result=new HashMap<String,Object>();
        result.put(ReturnJsonCode.RETURN_CODE, ReturnJsonCode.MsgCodeEnum.SUCCESS.getCode());
        result.put(ReturnJsonCode.RETURN_MSG, ReturnJsonCode.MsgCodeEnum.SUCCESS.getMsg());
        return result;
    }
    
    public static Map<String,Object> responseSuccess(Object data) {
        Map<String,Object> result=new HashMap<String,Object>();
        result.put(ReturnJsonCode.RETURN_CODE, ReturnJsonCode.MsgCodeEnum.SUCCESS.getCode());
        result.put(ReturnJsonCode.RETURN_MSG, ReturnJsonCode.MsgCodeEnum.SUCCESS.getMsg());
        result.put(ReturnJsonCode.RESULT_DATA, data);
        return result;
    }
    
    public static Map<String,Object> responseFail() {
        Map<String,Object> result=new HashMap<String,Object>();
        result.put(ReturnJsonCode.RETURN_CODE, ReturnJsonCode.MsgCodeEnum.FAILURE.getCode());
        result.put(ReturnJsonCode.RETURN_MSG, ReturnJsonCode.MsgCodeEnum.FAILURE.getMsg());
        return result;
    }
    
    public static Map<String,Object> responseFail(String errorInfo) {
        Map<String,Object> result=new HashMap<String,Object>();
        result.put(ReturnJsonCode.RETURN_CODE, ReturnJsonCode.MsgCodeEnum.FAILURE.getCode());
        result.put(ReturnJsonCode.RETURN_MSG, errorInfo);
        return result;
    }
    

}
